import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/home/duty/major_event_info_create_entity.dart';

MajorEventInfoCreateEntity $MajorEventInfoCreateEntityFromJson(Map<String, dynamic> json) {
  final MajorEventInfoCreateEntity majorEventInfoCreateEntity = MajorEventInfoCreateEntity();
  final String? dept = jsonConvert.convert<String>(json['dept']);
  if (dept != null) {
    majorEventInfoCreateEntity.dept = dept;
  }
  final String? dutyPerson = jsonConvert.convert<String>(json['dutyPerson']);
  if (dutyPerson != null) {
    majorEventInfoCreateEntity.dutyPerson = dutyPerson;
  }
  final String? dutyPersonPhone = jsonConvert.convert<String>(json['dutyPersonPhone']);
  if (dutyPersonPhone != null) {
    majorEventInfoCreateEntity.dutyPersonPhone = dutyPersonPhone;
  }
  final String? dutyLeader = jsonConvert.convert<String>(json['dutyLeader']);
  if (dutyLeader != null) {
    majorEventInfoCreateEntity.dutyLeader = dutyLeader;
  }
  final String? dutyLeaderPhone = jsonConvert.convert<String>(json['dutyLeaderPhone']);
  if (dutyLeaderPhone != null) {
    majorEventInfoCreateEntity.dutyLeaderPhone = dutyLeaderPhone;
  }
  final String? eventTime = jsonConvert.convert<String>(json['eventTime']);
  if (eventTime != null) {
    majorEventInfoCreateEntity.eventTime = eventTime;
  }
  final String? eventDesc = jsonConvert.convert<String>(json['eventDesc']);
  if (eventDesc != null) {
    majorEventInfoCreateEntity.eventDesc = eventDesc;
  }
  final String? eventReason = jsonConvert.convert<String>(json['eventReason']);
  if (eventReason != null) {
    majorEventInfoCreateEntity.eventReason = eventReason;
  }
  final String? measure = jsonConvert.convert<String>(json['measure']);
  if (measure != null) {
    majorEventInfoCreateEntity.measure = measure;
  }
  final String? remark = jsonConvert.convert<String>(json['remark']);
  if (remark != null) {
    majorEventInfoCreateEntity.remark = remark;
  }
  final String? eventAddr = jsonConvert.convert<String>(json['eventAddr']);
  if (eventAddr != null) {
    majorEventInfoCreateEntity.eventAddr = eventAddr;
  }
  return majorEventInfoCreateEntity;
}

Map<String, dynamic> $MajorEventInfoCreateEntityToJson(MajorEventInfoCreateEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['dept'] = entity.dept;
  data['dutyPerson'] = entity.dutyPerson;
  data['dutyPersonPhone'] = entity.dutyPersonPhone;
  data['dutyLeader'] = entity.dutyLeader;
  data['dutyLeaderPhone'] = entity.dutyLeaderPhone;
  data['eventTime'] = entity.eventTime;
  data['eventDesc'] = entity.eventDesc;
  data['eventReason'] = entity.eventReason;
  data['measure'] = entity.measure;
  data['remark'] = entity.remark;
  data['eventAddr'] = entity.eventAddr;
  return data;
}

extension MajorEventInfoCreateEntityExtension on MajorEventInfoCreateEntity {
  MajorEventInfoCreateEntity copyWith({
    String? dept,
    String? dutyPerson,
    String? dutyPersonPhone,
    String? dutyLeader,
    String? dutyLeaderPhone,
    String? eventTime,
    String? eventDesc,
    String? eventReason,
    String? measure,
    String? remark,
    String? eventAddr,
  }) {
    return MajorEventInfoCreateEntity()
      ..dept = dept ?? this.dept
      ..dutyPerson = dutyPerson ?? this.dutyPerson
      ..dutyPersonPhone = dutyPersonPhone ?? this.dutyPersonPhone
      ..dutyLeader = dutyLeader ?? this.dutyLeader
      ..dutyLeaderPhone = dutyLeaderPhone ?? this.dutyLeaderPhone
      ..eventTime = eventTime ?? this.eventTime
      ..eventDesc = eventDesc ?? this.eventDesc
      ..eventReason = eventReason ?? this.eventReason
      ..measure = measure ?? this.measure
      ..remark = remark ?? this.remark
      ..eventAddr = eventAddr ?? this.eventAddr;
  }
}